<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>对象和原型链上属性检测</title>
  </head>
  <body></body>
  <script>
    let arr = ["houdunren", "hdcms"];
    console.log(arr);
    console.log(arr.hasOwnProperty("length"));
    console.log(arr.hasOwnProperty("concat"));

    console.log("concat" in arr);

    let a = {
      name: "后盾人"
    };
    let b = {
      url: "houdunren.com"
    };
    Object.setPrototypeOf(a, b);
    console.log(a.hasOwnProperty("url"));
    console.log("url" in a);
  </script>
</html>
